package com.aliyun.messagemgt.dto.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 查询参数为
 * userId       必填，身份证号码
 * startTime    必填，搜索开始时间
 * endTime      必填，搜索结束时间
 * pageNum      非必填，起始页码，默认1
 * pageSize     非必填，搜索总记录条数，默认1000
 *
 * @Author: Xiaohang Lv
 * @Date: 2019/5/8 10:20
 */
public class OuterMsgDailyQuery {

    /**
     * 身份证号码
     */
    @NotNull(message = "userId 不能为空")
    @Size(min = 18, max = 18, message = "身份证号必须18位")
    private String userId;

    /**
     * 搜索开始时间
     */
    @NotNull(message = "startTime 不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    /**
     * 搜索结束时间
     */
    @NotNull(message = "endTime 不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    /**
     * 默认为1
     */
    private static final int DEFAULT_PAGE_NUM = 1;

    /**
     * 默认为1000
     */
    private static final int DEFAULT_PAGE_SIZE = 1000;

    /**
     * 起始页码，默认1
     */
    private Integer pageNum = DEFAULT_PAGE_NUM;

    /**
     * 搜索总记录条数，默认1000
     */
    private Integer pageSize = DEFAULT_PAGE_SIZE;

    public String getUserId() {
        return userId;
    }

    public OuterMsgDailyQuery setUserId(String userId) {
        this.userId = userId;
        return this;
    }

    public Date getStartTime() {
        return startTime;
    }

    public OuterMsgDailyQuery setStartTime(Date startTime) {
        this.startTime = startTime;
        return this;
    }

    public Date getEndTime() {
        return endTime;
    }

    public OuterMsgDailyQuery setEndTime(Date endTime) {
        this.endTime = endTime;
        return this;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public OuterMsgDailyQuery setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
        return this;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public OuterMsgDailyQuery setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
        return this;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

}
